package com.kujie.access.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 逾期枚举
 *
 * @author check
 * @date 2025-07-17
 */
@Getter
@AllArgsConstructor
public enum OverdueEnum {
    WITHIN_ONE_MONTH("一个月以内", "1", 30),
    WITHIN_THREE_MONTHS("三个月以内", "2", 90),
    MORE_THAN_THREE_MONTHS("三个月以上", "3", 91);
    private final String description;
    private final String code;
    private final int days;

    public static int getByCode(String code) {
        for (OverdueEnum value : values()) {
            if (value.code.equals(code)) {
                return value.getDays();
            }
        }
        return 0;
    }
}
